//
//  CommonUtil.cpp
//  xyz
//
//  Created by jorsun on 14-3-14.
//
//

#include "CommonUtil.h"
static CommonUtil* p_instance;
CommonUtil::CommonUtil(){
    
}
CommonUtil* CommonUtil::getInstance(){
    if(p_instance==NULL){
        p_instance=new CommonUtil();
    }
    return p_instance;
}
CommonUtil::~CommonUtil()
{
}
void CommonUtil::setPlayer(Player *player){
    this->player=player;
}
Player* CommonUtil::getPlayer(){
    return this->player;
}
void CommonUtil::loadResouce(){
    CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfoAsync(
                                                                                 "role/hero/girl.ExportJson", this,schedule_selector(CommonUtil::dataLoaded));
}
Player* CommonUtil::createPlayer(std::string name){
    Player* player=new Player(name);
    player=player;
    return player;
}
void CommonUtil::dataLoaded(float percent)
{
    if (percent >= 1)
    {
        CCLOG("----load ok");
    }
}